import { NextIntlClientProvider, useMessages } from "next-intl";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });
import { getTranslations } from "next-intl/server";
import CustomHeader from "@/components/header";
import {getMessages} from 'next-intl/server';

export async function generateMetadata(props: any) {
  const t = await getTranslations({locale: props.params.locale , namespace: "metadata" });
  return {
    title: t("title"),
    description: t("description"),
    keywords: t("keywords"),
    
  };
}

async function LangLayout({
  children,
  params: { locale },
}: {
  children: React.ReactNode;
  params: { locale: string };
}) {
  const messages = await getMessages();

  return (
    <html>
      <body>
        <NextIntlClientProvider
          messages={messages}
        >
          <CustomHeader></CustomHeader>
            {children}
        </NextIntlClientProvider>
        <footer className="bg-blue-500 py-2 text-center text-white">
          <div>©2024 - 广州东松科技有限公司 版权所有</div>
          <div>
            <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">
              粤ICP备2024227409号
            </a>
          </div>
        </footer>
      </body>
    </html>
  );
}
export default LangLayout;
